//
//  PaiFinishCell.m
//  PPDL
//
//  Created by 王洋 on 2019/8/2.
//  Copyright © 2019 王洋. All rights reserved.
//

#import "PaiFinishCell.h"

@interface PaiFinishCell ()

@property (weak, nonatomic) IBOutlet UIView *itemBGView;

@property (weak, nonatomic) IBOutlet UIImageView *itemMainImage;

@property (weak, nonatomic) IBOutlet UILabel *itemGoodName;
@property (weak, nonatomic) IBOutlet UILabel *itemPaiUserName;

@property (weak, nonatomic) IBOutlet UILabel *itemPaiPrice;

@end

@implementation PaiFinishCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)fillFinishCellWithInfoModel:(DetailGoodInfoModel *)infoModel AndPriceModel:(UserPaiPriceModel *)priceModel {
    
    [self.itemMainImage sd_setImageWithURL:[NSURL URLWithString:infoModel.itemImageArray.firstObject] placeholderImage:[UIImage imageNamed:@"placeholder_rect"] options:SDWebImageRetryFailed];
    
    self.itemGoodName.text = [NSString stringWithFormat:@"%@",infoModel.itemGoodName];
    self.itemPaiUserName.text =  [NSString stringWithFormat:@"%@",priceModel.userName];
    self.itemPaiPrice.text = [NSString stringWithFormat:@"%.2f",priceModel.price];
    
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [self.itemBGView pp_clipCorners:UIRectCornerAllCorners radius:5 border:0.5 color:PP_Default_Color_Orange_E8AC44];
        self.itemBGView.clipsToBounds = NO;
        [self.itemMainImage pp_clipCorners:UIRectCornerAllCorners radius:5];
    });

}


@end
